<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">	
<ui:composition template="/pages/layout/masterLayout.xhtml">
	<ui:define name="tituloPagina">Gerenciar Conta</ui:define>
	<ui:define name="conteudo">
		<t:saveState value="#{loginBean.usuarioLogado}" />
		<div style="width: 100%; clear:both;">
			<br/>
			<h1>:: Alterar - Dados e Preferência de Estilo ::</h1>
			<h2>Dados pessoais</h2>
			<h:messages globalOnly="true"/>			
			<h:form>
			<div style="width: 100%">
				&nbsp;&nbsp;&nbsp;Nome:
				<h:inputText id="itNome" label="Nome" value="#{loginBean.usuarioLogado.nome}" required="true"
					validatorMessage="Nome inválido! Digite seu nome e sobrenome." style="width : 200px;">
					<f:validateRegex pattern="\p{L}+(\s\p{L}+)+" /> <!-- "\p{Alpha}+(\s\p{Alpha}+)+" -->
					<f:validateLength maximum="100" />
				</h:inputText>
			</div>
			<br />
			<h:message for="itNome"/>
			<div style="width: 100%">
				&nbsp;&nbsp;e-mail:				
				<h:inputText id="itEmail" label="email" value="#{loginBean.usuarioLogado.email}"
					required="true"	validator="#{gerenciaUsuario.validaEmail}" style="width : 200px;">
					<f:validateLength maximum="100"/>
				</h:inputText>
			</div>
			<h:message for="itEmail"/>					
			<h2>Dados para utilização do site</h2>
			Login:  <h:inputText id="itLogin" value="#{loginBean.usuarioLogado.login}" required="true" validator="#{gerenciaUsuario.validaLogin}" /><br/>
			<h:message for="itLogin"/>
			Senha: <h:inputText value="#{loginBean.usuarioLogado.senha}" required="true" /><br/>									
			CSS:
			<h:selectOneMenu value="#{loginBean.usuarioLogado.cssEscolhido}">
				<f:selectItems value="#{configuracaoBean.layoutsCSS}" />
			</h:selectOneMenu><br/>
			<br />		
				<h:commandButton value=" Alterar " action="#{loginBean.atualizaCadastro}" />
			</h:form>
		</div>
	</ui:define>
</ui:composition>
</html>